package com.ruoyi.production.service.impl.pesticide;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.production.domain.pesticide.PesticidePurchaseApply;
import com.ruoyi.production.mapper.pesticide.PesticidePurchaseApplyMapper;
import com.ruoyi.production.service.pesticide.IPesticidePurchaseApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 农药购买申请Service业务层处理
 *
 * @author testlove
 * @date 2021-07-11
 */
@Service
public class PesticidePurchaseApplyServiceImpl implements IPesticidePurchaseApplyService
{
    @Autowired
    private PesticidePurchaseApplyMapper pesticidePurchaseApplyMapper;

    /**
     * 查询农药购买申请
     *
     * @param pesticidePurchaseApplyId 农药购买申请ID
     * @return 农药购买申请
     */
    @Override
    public PesticidePurchaseApply selectPesticidePurchaseApplyById(Long pesticidePurchaseApplyId)
    {
        return pesticidePurchaseApplyMapper.selectPesticidePurchaseApplyById(pesticidePurchaseApplyId);
    }

    /**
     * 查询农药购买申请列表
     *
     * @param pesticidePurchaseApply 农药购买申请
     * @return 农药购买申请
     */
    @Override
    public List<PesticidePurchaseApply> selectPesticidePurchaseApplyList(PesticidePurchaseApply pesticidePurchaseApply)
    {
        return pesticidePurchaseApplyMapper.selectPesticidePurchaseApplyList(pesticidePurchaseApply);
    }

    /**
     * 新增农药购买申请
     *
     * @param pesticidePurchaseApply 农药购买申请
     * @return 结果
     */
    @Override
    public int insertPesticidePurchaseApply(PesticidePurchaseApply pesticidePurchaseApply)
    {
        pesticidePurchaseApply.setCreateTime(DateUtils.getNowDate());
        return pesticidePurchaseApplyMapper.insertPesticidePurchaseApply(pesticidePurchaseApply);
    }

    /**
     * 修改农药购买申请
     *
     * @param pesticidePurchaseApply 农药购买申请
     * @return 结果
     */
    @Override
    public int updatePesticidePurchaseApply(PesticidePurchaseApply pesticidePurchaseApply)
    {
        pesticidePurchaseApply.setUpdateTime(DateUtils.getNowDate());
        return pesticidePurchaseApplyMapper.updatePesticidePurchaseApply(pesticidePurchaseApply);
    }

    /**
     * 批量删除农药购买申请
     *
     * @param pesticidePurchaseApplyIds 需要删除的农药购买申请ID
     * @return 结果
     */
    @Override
    public int deletePesticidePurchaseApplyByIds(Long[] pesticidePurchaseApplyIds)
    {
        return pesticidePurchaseApplyMapper.deletePesticidePurchaseApplyByIds(pesticidePurchaseApplyIds);
    }

    /**
     * 删除农药购买申请信息
     *
     * @param pesticidePurchaseApplyId 农药购买申请ID
     * @return 结果
     */
    @Override
    public int deletePesticidePurchaseApplyById(Long pesticidePurchaseApplyId)
    {
        return pesticidePurchaseApplyMapper.deletePesticidePurchaseApplyById(pesticidePurchaseApplyId);
    }
}
